import Vue from 'vue'
import Router from 'vue-router'
import Home from '../views/Home.vue'
import Index from '../views/Index.vue'
import Menu from '../views/sys/Menu.vue'
import Role from '../views/sys/Role.vue'
import User from '../views/sys/User.vue'

Vue.use(Router)

const routes = [
  {
    path: '/',
    name: 'Home',
    children: [
      {
        path: '/index',
        name: 'Index',
        component: Index
      },
      {
        path: '/menus',
        name: 'SysMenu',
        component: Menu
      },
      {
        path: '/roles',
        name: 'SysRole',
        component: Role
      },
      {
        path: '/users',
        name: 'SysUser',
        component: User
      }
    ],
    component: Home
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login.vue')
  }
]
const router = new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})
export default router
